import {
	generWorkFlow,
	getEnums,
	getSFTable,
	athDelete,
	athDownload,
	athInit,
	dtlInit,
	deleteDtlRow,
	saveDtlRow,
	getNodeMsg,
	frmGenerInit,
	sendFlow,
	entityInit,
	unSendFlow,
	returnInit,
	returnFlow,
	forceAccepter,
	selectEmpsInit,
	accepterOfGenerDel,
	accepterAddEmps,
	getAccepter,
	accepterOfGenerInit,
	accepterInit,
	accepterSend,
	getSFTableKey,
	runUrlReturnString
} from '../../api/flow.js'

export default {
	state: {},
	mutations: {

	},
	getters: {

	},
	actions: {
		generWorkFlow({}, payload) {
			return new Promise((resolve, reject) => {
				generWorkFlow(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		getEnums({}, payload) {
			return new Promise((resolve, reject) => {
				getEnums(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		getSFTable({}, payload) {
			return new Promise((resolve, reject) => {
				getSFTable(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		athDelete({}, payload) {
			return new Promise((resolve, reject) => {
				athDelete(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		athDownload({}, payload) {
			return new Promise((resolve, reject) => {
				athDownload(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		athInit({}, payload) {
			return new Promise((resolve, reject) => {
				athInit(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		dtlInit({}, payload) {
			return new Promise((resolve, reject) => {
				dtlInit(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		deleteDtlRow({}, payload) {
			return new Promise((resolve, reject) => {
				deleteDtlRow(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		saveDtlRow({}, payload) {
			return new Promise((resolve, reject) => {
				saveDtlRow(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		getNodeMsg({}, payload) {
			return new Promise((resolve, reject) => {
				getNodeMsg(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		frmGenerInit({}, payload) {
			return new Promise((resolve, reject) => {
				frmGenerInit(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		sendFlow({}, payload) {
			return new Promise((resolve, reject) => {
				sendFlow(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		entityInit({}, payload) {
			return new Promise((resolve, reject) => {
				entityInit(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		unSendFlow({}, payload) {
			return new Promise((resolve, reject) => {
				unSendFlow(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		returnInit({}, payload) {
			return new Promise((resolve, reject) => {
				returnInit(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		returnFlow({}, payload) {
			return new Promise((resolve, reject) => {
				returnFlow(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		forceAccepter({}, payload) {
			return new Promise((resolve, reject) => {
				forceAccepter(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		selectEmpsInit({}, payload) {
			return new Promise((resolve, reject) => {
				selectEmpsInit(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		accepterOfGenerDel({}, payload) {
			return new Promise((resolve, reject) => {
				accepterOfGenerDel(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		accepterAddEmps({}, payload) {
			return new Promise((resolve, reject) => {
				accepterAddEmps(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		getAccepter({}, payload) {
			return new Promise((resolve, reject) => {
				getAccepter(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		accepterOfGenerInit({}, payload) {
			return new Promise((resolve, reject) => {
				accepterOfGenerInit(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		accepterInit({}, payload) {
			return new Promise((resolve, reject) => {
				accepterInit(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		accepterSend({}, payload) {
			return new Promise((resolve, reject) => {
				accepterSend(payload).then(res => {
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		getSFTableKey({}, payload) {
			return new Promise((resolve, reject) => {
				getSFTableKey(payload)
					.then(res => {
						resolve(res);
					})
					.catch(err => {
						reject(err);
					});
			});
		},
		runUrlReturnString({}, payload) {
			return new Promise((resolve, reject) => {
				runUrlReturnString(payload)
					.then(res => {
						resolve(res);
					})
					.catch(err => {
						reject(err);
					});
			});
		}
	},
	namespaced: true
}
